package day5;

import java.util.Scanner;

/**
 * ClassName：Student
 *
 * @Author：小鱼
 * @Create：2025-08-08 11:36
 */
public class Student {
    private String id;
    private String name;
    private String score;

    public Student() {
    }

    public Student(String id, String name, String score) {
        this.id = id;
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        //从键盘获取学生信息
        System.out.println("请输入你的信息，格式为：学号:姓名:分数，例：001:zs:78");
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] st = s.split(":");
        id = st[0];
        name = st[1];
        score = st[2];
        return "Student[" +
                "id：" + id +
                ", name：" + name +
                ", score：" + score +
                ']';
    }
}
